﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Zj.CourseManage.Domain.Events
{
    /// <summary>
    /// Message serializer
    /// </summary>
    public interface IMessageSerializer
    {
        byte[] Serialize<TMessage>(TMessage message)
            where TMessage : IEvent;



        IEvent DeSerialize(byte[] value);



        Task<byte[]> SerializeAsync<TMessage>(TMessage message)
            where TMessage : IEvent;



        Task<IEvent> DeSerializeAsync(byte[] value);
    }
}
